#!/bin/sh

# Oracle prefix path
ORACLEPREFIX="/usr/lib/oracle"

case $2 in
INSTALL)
  # search for Linux ABI module loaded in the kernel
  linux_loaded=false
  if kldstat | egrep -q -e "linux.ko" ; then
     linux_loaded=true
  fi
  if kldstat -q -m "linuxelf" ; then
     linux_loaded=true
  fi
  if ! $linux_loaded ; then
     echo "Linux ABI module not loaded"
     exit 1
  fi

  # search for mounted Linux /proc filesystem
  if mount | egrep -q -e "^linprocfs" ; then
  else
     echo "Linux /proc filesystem (linprocfs) not mounted"
     exit 2
  fi

  exit 0
  ;;

DEINSTALL)
  #XXX
  sh ${ORACLEPREFIX}/xe/app/oracle/product/10.2.0/server/config/scripts/stopall.sh

  exit 0
  ;;

*)
  ;;
esac

